{% extends "base.html" %}

{% block content %}
			<ul class="nav nav-tabs">
                {% if navStatus == 'all' %}
				<li class="active">
                {% else %}
                <li>
                {% endif %}
					 <a href="/allworkflow/?pageNo=0&navStatus=all">全部工单</a>
				</li>

				{% if role == '审核人' %}
				{% if navStatus == 'waitingforme' %}
				<li class="active">
                {% else %}
                <li>
                {% endif %}
					 <a href="/allworkflow/?pageNo=0&navStatus=waitingforme">待我审核的</a>
				</li>
				{% endif %}

				{% if navStatus == 'finish' %}
				<li class="active">
                {% else %}
                <li>
                {% endif %}
					 <a href="/allworkflow/?pageNo=0&navStatus=finish">已执行完毕</a>
				</li>

				{% if navStatus == 'executing' %}
				<li class="active">
                {% else %}
                <li>
                {% endif %}
					 <a href="/allworkflow/?pageNo=0&navStatus=executing">执行中</a>
				</li>

				{% if navStatus == 'abort' %}
				<li class="active">
                {% else %}
                <li>
                {% endif %}
					 <a href="/allworkflow/?pageNo=0&navStatus=abort">人工终止流程</a>
				</li>

				{% if navStatus == 'autoreviewwrong' %}
				<li class="active">
                {% else %}
                <li>
                {% endif %}
					 <a href="/allworkflow/?pageNo=0&navStatus=autoreviewwrong">自动审核不通过的</a>
				</li>

			</ul>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>
							工单ID
						</th>
						<th>
							工单名称
						</th>
						<th>
							发起人
						</th>
						<th>
							工单状态
						</th>
						<th>
							发起时间
						</th>
						<th>
							目标集群
						</th>
					</tr>
				</thead>
				<tbody>
					{% for workflow in listWorkflow %}
					<tr>
						<td>
							{{workflow.id}}
						</td>
						<td>
							<a href="/detail/{{workflow.id}}/">{{workflow.workflow_name}}</a>
						</td>
						<td>
							{{workflow.engineer}}
						</td>
						<td>
							{{workflow.status}}
						</td>
						<td>
							{{workflow.create_time|date:"Y-m-d H:i:s"}}
						</td>
						<td>
							{{workflow.cluster_name}}
						</td>
					</tr>
					{% empty %}
					<tr>
						<td>当前状态暂无工单，嘿嘿嘿.</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						
					</tr>
					{% endfor %}
										
				</tbody>
			</table>
			<div style="text-align:center;">
			<ul class="pagination" style="display:inline-block;">
				<li>
					 <a href="/allworkflow/?pageNo={{pageNo|add:"-1"}}&navStatus={{navStatus}}">前一页</a>
				</li>
				<li class="active">
					 <a href="/allworkflow/?pageNo={{pageNo|add:"0"}}&navStatus={{navStatus}}">{{pageNo|add:"1"}}</a>
				</li>
				{% if listWorkflow|length >= PAGE_LIMIT %}
				<li>
					 <a href="/allworkflow/?pageNo={{pageNo|add:"1"}}&navStatus={{navStatus}}">{{pageNo|add:"2"}}</a>
				</li>
				<li>
					 <a href="/allworkflow/?pageNo={{pageNo|add:"2"}}&navStatus={{navStatus}}">{{pageNo|add:"3"}}</a>
				</li>
				<li>
					 <a href="/allworkflow/?pageNo={{pageNo|add:"3"}}&navStatus={{navStatus}}">{{pageNo|add:"4"}}</a>
				</li>
				<li>
					 <a href="/allworkflow/?pageNo={{pageNo|add:"4"}}&navStatus={{navStatus}}">{{pageNo|add:"5"}}</a>
				</li>
				<li>
					 <a href="/allworkflow/?pageNo={{pageNo|add:"1"}}&navStatus={{navStatus}}">后一页</a>
				</li>
				{% endif %}
			</ul>
			</div>
{% endblock content%}
